// =====================================================================
//
//  This file is part of the Microsoft Dynamics CRM SDK code samples.
//
//  Copyright (C) Microsoft Corporation.  All rights reserved.
//
//  This source code is intended only as a supplement to Microsoft
//  Development Tools and/or on-line documentation.  See these other
//  materials for detailed information regarding Microsoft code samples.
//
//  THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY
//  KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
//  IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A
//  PARTICULAR PURPOSE.
//
// =====================================================================
using System;
using System.Runtime.Serialization;
using Microsoft.Xrm.Sdk.Temporary;

namespace Microsoft.Crm.Sdk.Messages
{
	/// <summary>
	/// Defines a party in AppointmentProposal.
	/// </summary>
	[DataContract(Namespace = "http://schemas.microsoft.com/crm/2011/Contracts")]
	public sealed class ProposalParty : IExtensibleDataObject
	{
		/// <summary>
		/// Even though this constructor does not do anything, it is still needed because 
		/// XmlSerializer requires public default constructor on the class to be serialized.
		/// </summary>
		public ProposalParty()
		{
		}

		/// <summary>
		/// Initializes a ProposalParty object. 
		/// </summary>
		/// <param name="resourceId">ResourceId of this party.</param>
		/// <param name="resourceSpecId">ResourceSpecId of this party.</param>
		/// <param name="displayName">Name of party entry.</param>
		/// <param name="objectTypeCode">Object type code of party entry.</param>
		/// <param name="effortRequired">effort required of party entry.</param>
		public ProposalParty(Guid resourceId, Guid resourceSpecId, string displayName, string entityName, double effortRequired)
		{
			this.ResourceId = resourceId;
			this.ResourceSpecId = resourceSpecId;
			this.DisplayName = displayName;
			this.EntityName = entityName;
			this.EffortRequired = effortRequired;
		}

		/// <summary>
		/// ResourceId of this party.
		/// </summary>
		[DataMember]
		public Guid ResourceId { get; set; }

		/// <summary>
		/// ResourceSpecId of this party.
		/// </summary>
		[DataMember]
		public Guid ResourceSpecId { get; set; }

		/// <summary>
		/// Display name.
		/// </summary>
		[DataMember]
		public string DisplayName { get; set; }

		/// <summary>
		/// Name of entity type.
		/// </summary>
		[DataMember]
		public string EntityName { get; set; }

		/// <summary>
		/// Effort required.
		/// </summary>
		[DataMember]
		public double EffortRequired { get; set; }

		#region IExtensibleDataObject Implementation
		private ExtensionDataObject _extensionDataObject;
		public ExtensionDataObject ExtensionData
		{
			get
			{
				return _extensionDataObject;
			}
			set
			{
				_extensionDataObject = value;
			}
		}
		#endregion IExtensibleDataObject Implementation
	}
}
